package list;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ListFor {
    @SuppressWarnings({"all"})
    public static void main(String[] args) {
        List list = new ArrayList();
        list.add("小白");
        list.add("小黑");
        list.add("小青");
        list.add("阿宣");
        Iterator iterator = list.iterator();
        while (iterator.hasNext()) {
            Object next =  iterator.next();
            System.out.println(next);
        }
        for (Object o :list) {
            System.out.println("o" + o);
        }
        for (int i = 0 ;i < list.size();i++){
            System.out.println(list.get(i));
        }
    }
}
